/**
 * Created by Administrator on 2017/7/7 0007.
 */
define(["jquery", "template","bbcare","scprit/department/view/template/queueManagement/queueManagement-tpl.js"], function ($,template,$bb, tpl) {
    var question = {};
    var inTable = function (data) {
        return template("queuelist-tpl", data);
    }
    question.queuelist = function (options) {
        $("body").append(tpl.init());
        var html = inTable(options.data);
        $(options.id).append(html);
    }
    question.dataDeal=function(data){
        var obj=data;
         for(var i=0;i<data.length;i++){
             data[i].schemeName == undefined ? obj[i].schemeName = "暂无方案" : obj[i].schemeName = data[i].schemeName;
             if(data[i].targetNum == "-1" ){
                 obj[i].targetNum = "无上限";
                 obj[i].width=0;
             }else{
                 obj[i].width=100*data[i].currNum/data[i].targetNum+"%";
             }
         }
        return obj;
    }
    return question;
});
